Optimal. Leaf size=76 \[ \frac{2 (b c-a d) \tanh ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{a+b}}\right )}{b f \sqrt{a-b} \sqrt{a+b}}+\frac{d \tanh ^{-1}(\sin (e+f x))}{b f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.126988, antiderivative size = 76, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.172, Rules used = {3998, 3770, 3831, 2659, 208} \[ \frac{2 (b c-a d) \tanh ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{a+b}}\right )}{b f \sqrt{a-b} \sqrt{a+b}}+\frac{d \tanh ^{-1}(\sin (e+f x))}{b f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3998
Rule 3770
Rule 3831
Rule 2659
Rule 208
Rubi steps
\begin{align*} \int \frac{\sec (e+f x) (c+d \sec (e+f x))}{a+b \sec (e+f x)} \, dx &=\frac{d \int \sec (e+f x) \, dx}{b}+\frac{(b c-a d) \int \frac{\sec (e+f x)}{a+b \sec (e+f x)} \, dx}{b}\\ &=\frac{d \tanh ^{-1}(\sin (e+f x))}{b f}+\frac{(b c-a d) \int \frac{1}{1+\frac{a \cos (e+f x)}{b}} \, dx}{b^2}\\ &=\frac{d \tanh ^{-1}(\sin (e+f x))}{b f}+\frac{(2 (b c-a d)) \operatorname{Subst}\left (\int \frac{1}{1+\frac{a}{b}+\left (1-\frac{a}{b}\right ) x^2} \, dx,x,\tan \left (\frac{1}{2} (e+f x)\right )\right )}{b^2 f}\\ &=\frac{d \tanh ^{-1}(\sin (e+f x))}{b f}+\frac{2 (b c-a d) \tanh ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{a+b}}\right )}{\sqrt{a-b} b \sqrt{a+b} f}\\ \end{align*}
Mathematica [A] time = 0.183553, size = 112, normalized size = 1.47 \[ \frac{\frac{2 (a d-b c) \tanh ^{-1}\left (\frac{(b-a) \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}}+d \left (\log \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )-\log \left (\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )\right )\right )}{b f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.063, size = 135, normalized size = 1.8 \begin{align*} -2\,{\frac{ad}{fb\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}{\it Artanh} \left ({\frac{ \left ( a-b \right ) \tan \left ( 1/2\,fx+e/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) }+2\,{\frac{c}{f\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}{\it Artanh} \left ({\frac{ \left ( a-b \right ) \tan \left ( 1/2\,fx+e/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) }+{\frac{d}{fb}\ln \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +1 \right ) }-{\frac{d}{fb}\ln \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) -1 \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.53203, size = 694, normalized size = 9.13 \begin{align*} \left [\frac{{\left (a^{2} - b^{2}\right )} d \log \left (\sin \left (f x + e\right ) + 1\right ) -{\left (a^{2} - b^{2}\right )} d \log \left (-\sin \left (f x + e\right ) + 1\right ) - \sqrt{a^{2} - b^{2}}{\left (b c - a d\right )} \log \left (\frac{2 \, a b \cos \left (f x + e\right ) -{\left (a^{2} - 2 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, \sqrt{a^{2} - b^{2}}{\left (b \cos \left (f x + e\right ) + a\right )} \sin \left (f x + e\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (f x + e\right )^{2} + 2 \, a b \cos \left (f x + e\right ) + b^{2}}\right )}{2 \,{\left (a^{2} b - b^{3}\right )} f}, \frac{{\left (a^{2} - b^{2}\right )} d \log \left (\sin \left (f x + e\right ) + 1\right ) -{\left (a^{2} - b^{2}\right )} d \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, \sqrt{-a^{2} + b^{2}}{\left (b c - a d\right )} \arctan \left (-\frac{\sqrt{-a^{2} + b^{2}}{\left (b \cos \left (f x + e\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (f x + e\right )}\right )}{2 \,{\left (a^{2} b - b^{3}\right )} f}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (c + d \sec{\left (e + f x \right )}\right ) \sec{\left (e + f x \right )}}{a + b \sec{\left (e + f x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.28417, size = 178, normalized size = 2.34 \begin{align*} \frac{\frac{d \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1 \right |}\right )}{b} - \frac{d \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 1 \right |}\right )}{b} - \frac{2 \,{\left (\pi \left \lfloor \frac{f x + e}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac{a \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - b \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{\sqrt{-a^{2} + b^{2}}}\right )\right )}{\left (b c - a d\right )}}{\sqrt{-a^{2} + b^{2}} b}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]